package org.nf.trading.service.es.document.product;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;


@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(indexName = "product", createIndex = false)
public class ProductDoc {
    @Id
    private Integer productId;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String productName;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String productDescription;

    @Field(type = FieldType.Keyword)
    private String productImg;

    @Field(type = FieldType.Double)
    private BigDecimal productPrice;
}
